The present disclosure generally relates to processor utilization, and more specifically, to averting lock contention by controlling active hardware threads.
Modern processors can employ multiple cores for reading and executing program instructions. Multi-threading is the ability of a single core to execute multiple processes or threads concurrently. These threads or streams of execution can be employed by operating systems or hypervisors to execute programs. Hardware threading improves the throughput of a core, or the rate at which instructions pass through the core, by overlapping the hardware stalls associated with sequential streams of execution.
As the utilization of the workload increases, so that more and more hardware threads can be employed to improve throughput, the rate at which each software thread executes instructions may drop due to core resource contention. That is, the resources of the core are split in some way amongst the threads. Resource contention has a negative side effect: the per-thread performance is decreased and this can affect the serialization in the instructions. A typical result is increased lock contention: a software threads holds a lock and prevents another software thread from proceeding. The blocking thread must wait until the lock is released to proceed with execution. This reduces overall throughput and response time for the system as a whole.